import request from '@/config/axios'

export const accountAuthorizePage = async (params) => {
  return await request.getDYXT({
    url: '/account-authorize/page',
    params
  })
}

export const accountAuthorize = async (data) => {
  return await request.putDYXT({
    url: '/account-authorize/accountAuthorize',
    data
  })
}

export const unbindAuthorize = async (data) => {
  return await request.putDYXT({
    url: '/account-authorize/unbind',
    data
  })
}

export const bindDataShare = async (data) => {
  return await request.putDYXT({
    url: '/account-authorize/bindDataShare',
    data
  })
}

export const unbindDataShare = async (id) => {
  return await request.putDYXT({
    url: `/account-authorize/unbindDataShare?authorizeDataId=${id}`
  })
}

export const getOutTenantList = async () => {
  return await request.getDYXT({
    url: '/account-authorize/getOutTenantList'
  })
}

export const getOutTenantListByIdentity = async (
  params
) => {
  return await request.getDYXT({
    url: '/account-authorize/getOutTenantListByIdentity',
    params
  })
}

export const getCustomerListByIdentity = async (
  params
) => {
  return await request.getDYXT({
    url: '/account-authorize/get-customer-list-by-identity',
    params
  })
}
